package com.wc.shj.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@TableName(value = "t_user")
public class User implements Serializable {
    private static final long serialVersionUID =1L;
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    @TableField(value = "openid")
    private String openid;
    @TableField(value = "property")
    private String property;
    @TableField(value = "real_name")
    private String realName;
    @TableField(value = "password")
    private String password;
    @TableField(value = "nickname")
    private String nickName;
    @TableField(value = "plot")
    private String plot;
    @TableField(value = "avatar_url")
    private String avatarUrl;
    @TableField(value = "createDate", fill = FieldFill.INSERT)
    //后端传给前端的时间格式
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    //前端传给后端的时间格式
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;
    @TableField(value = "delete_flag")
    private Integer deleteFlag;
}

